#ifndef _PICTURE_GUI_H_
#define _PICTURE_GUI_H_

#include "lvgl.h"

#define CELL_W 240
#define CELL_H 140

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _img_info
{
    int w;
    int h;
    const uint8_t *img_map;
    int bpp;
}ImgInfo;

typedef struct _img_data
{
    int tag;
    lv_img_dsc_t *src;
}ImgData;

typedef void (*get_image_cb_t)(int, ImgInfo*);    
typedef void (*exit_cb_t)(lv_event_t *);
typedef int (*get_tag_cb_t)(int);
typedef void (*change_list_cb_t)(int);
typedef void (*change_list_ready_cb_t)(void);

typedef struct _gui_opt
{
    get_image_cb_t get_image;
    exit_cb_t exit_cb;
    get_tag_cb_t get_prev_tag;
    get_tag_cb_t get_next_tag;
    change_list_cb_t change_list_page;        //切换页面,参数为列表索引
}gui_opt_t;

void picture_gui_init(gui_opt_t *gui_opts);
const uint8_t *picture_gui_list_add_img(ImgInfo info,  int tag);
void picture_gui_list_clear(void);
void picture_gui_set_img_list_page(int total);
void picture_gui_change_img(int tag, bool dir);
void picture_gui_set_list_change_over(void);
void picture_gui_release();


#ifdef __cplusplus
}
#endif



#endif


